package com.lm.sharding.service;

import com.lm.sharding.mapper.OrderMapper;
import com.lm.sharding.model.Order;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class OrderService {

    private final OrderMapper mapper;

    public OrderService(OrderMapper mapper) {
        this.mapper = mapper;
    }

    public void createOrder(Order order) {
        mapper.insert(order);
    }

    public List<Order> getOrdersByUser(Long userId) {
        return mapper.findByUserId(userId);
    }
}
